<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>最高位数字</title>
		<script>
		var input=prompt("请输入一个正整数：");
		var num=parseInt(input);
		if(isNaN(num))
		{
			alert("你输入的不是数字！")
		}
		else if(num<0)
		{
			alert("你输入的不是正整数！")
		}
		else
		{
			var highest;
			do
			{
				highest=num%10;
				num=parseInt(num/10);
			}while(num!=0);
			alert("最高位是"+highest);
		}
		</script>
	</head>
	<body>
	</body>
</html>
